﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _05_DifferenceOfWorkdaysBetweenTwoDays
{
    class Program
    {
        static DateTime[] Holidays()
        {
            DateTime[] holidays = new DateTime[]
            {
                new DateTime(2013, 01, 30),
                new DateTime(2013, 02, 23),
                new DateTime(2013, 03, 30),
                new DateTime(2013, 05, 30),
                new DateTime(2013, 07, 30),
                new DateTime(2013, 11, 30),
                new DateTime(2013, 12, 30),
                
            };
            return holidays;
        }

        static void Main(string[] args)
        {
            DateTime[] holidays = Holidays();
            Console.WriteLine("enter month and day");
            int month = int.Parse(Console.ReadLine());
            int day  = int.Parse(Console.ReadLine());
            Console.WriteLine("Enter month and day for searched date");
            DateTime current = new DateTime(2013, month, day);

            int monthToReach = int.Parse(Console.ReadLine());
            int dayToReach = int.Parse(Console.ReadLine());

            DateTime dateToReach = new DateTime(2013, monthToReach, dayToReach);

            int dayCounter = 0;
            bool isHoliday = false;

            while (true)
            {
                isHoliday = false;
                current = current.AddDays(1);
                if (current.DayOfWeek == DayOfWeek.Saturday || current.DayOfWeek == DayOfWeek.Sunday)
                {
                    continue;
                }
                for (int index = 0; index < holidays.Length; index++)
                {
                    if (current == holidays[index])
                    {
                        isHoliday = true;
                        break;
                    }
                }
                if (!isHoliday)
                {
                    dayCounter++;
                }
                if (current == dateToReach)
                {
                    break;
                }
            }
            Console.WriteLine("The difference is working days between the two dates is {0} days", dayCounter);
        }
    }
}